local PartnerEquipPropRender = app.mvc.createRenderClass(...)

--data =
function PartnerEquipPropRender.create(node)
    local sprite = PartnerEquipPropRender.extend(node or cc.CSLoader:createNode(Res.PartnerEquipStrengthProp))
    if node == nil then
        ccui.Helper:doLayout(sprite)
    end
    sprite:init()
    return sprite
end


function PartnerEquipPropRender:init(data)
    self.super.init(self, data)
    self:setContentSize( self._ui.Panel:getContentSize() )
    self:refresh()
    
   
end

function PartnerEquipPropRender:refresh()
    if not self._data then
        return
    end
 
    local data = self._data

    self._ui["Panel/lv_tlt"]:setString(string.format(L("PartnerEquipStrengthPropTitle"), data.lv))
    for i = 1, 3 do
        local prop = data.props[i]
        if prop then
            self._ui["Panel/data_tlt_"..i]:setVisible(true)
            self._ui["Panel/data_tlt_"..i]:setString(prop.name)
            self._ui["Panel/data_num_"..i]:setVisible(true)
            self._ui["Panel/data_num_"..i]:setString("+"..prop.value)
        else
            self._ui["Panel/data_tlt_"..i]:setVisible(false)
            self._ui["Panel/data_num_"..i]:setVisible(false)
        end
    end
end

return PartnerEquipPropRender